package biz

import (
	"context"
	v1 "stwin.net/api/st-demo/demoV1"
	"stwin.net/zoro/zcode"
	"stwin.net/zoro/zresp"
)

func (u *Usecase) AddDemoData(ctx context.Context, age int64, name string) (*v1.AddDemoDataResp, error) {
	resp := new(v1.AddDemoDataResp)
	// 处理业务逻辑
	if err := u.repo.SaveUser(ctx, age, name); err != nil {
		return nil, zresp.FailResult(ctx, zcode.SaveDBFail, err)
	}
	resp.Success = "保存成功"
	return resp, nil
}
func (u *Usecase) AddDemoData2(ctx context.Context, age int64, name string) (*v1.AddDemoData2Resp, error) {
	resp := new(v1.AddDemoData2Resp)
	// 处理业务逻辑
	if err := u.repo.SaveUser(ctx, age, name); err != nil {
		return nil, zresp.FailResult(ctx, zcode.SaveDBFail, err)
	}
	resp.Success = "保存成功"
	return resp, nil
}
